package com.mybatis.controller;

import com.mybatis.pojo.Mybatis;
import com.mybatis.service.impl.MybatisServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MybatisController {

    @Autowired
    private MybatisServiceImpl mybatisService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public void findAll() {
        List<Mybatis> mybatisList = mybatisService.findAll();
        System.out.println(mybatisList.size());
        for (Mybatis mybatis : mybatisList) {
            System.out.println(mybatis.getVerId());
        }
    }
}
